/* 
 * File:   DescriptorReader.h
 * Author: max
 *
 * Created on April 3, 2013, 11:41 PM
 */

#ifndef DESCRIPTORREADER_H
#define	DESCRIPTORREADER_H

#include <iostream>
using namespace std;

namespace TP3 { namespace Mangling {

#define MAX_CNT_PARAMS 10
    
class Descriptor {

public:
    
    Descriptor(char delimiter);
    
    virtual ~Descriptor();
    
    string& getName();
    
    string* getParameters();
    
    int getCntParameters();
    
    void reset();
    
    friend istream& operator>> (istream& input, Descriptor& reader);
    
    string& toString ();
    
private:
    char _delimiter;
    string _ruleName;
    string _params [MAX_CNT_PARAMS];
    int _cntParams;
    string _representation;
    
    void readDescriptorData (string& descriptor, istream& input, const char delimiter);
    
    void parseDescriptorData (Descriptor& descriptor, const string& descriptorData);
};

}}

#endif	/* DESCRIPTORREADER_H */

